package com.backend.models;

import io.ebean.ExpressionList;
import io.ebean.Finder;
import io.ebean.Model;
import lombok.Data;

import javax.persistence.*;

@Entity
@Table(name = "img_storge")
@Data
public class ImageStorge extends Model {
    @Id
    public Integer id;
    public Integer boomId;
    public String uuid;
    public String path;
    public boolean deleted = false;
    public Integer orderNum;
    @Enumerated(EnumType.STRING)
    public IMAGE_TYPE category;

    public static enum IMAGE_TYPE{
        PRODUCT
    }

    public static Finder<Integer, ImageStorge> find = new Finder<>(ImageStorge.class);

    public static ExpressionList<ImageStorge> search() {
        return ImageStorge.find.query().where();
    }
}
